using log4net;
using log4net.Config;
using quartz_service.JobModels;
using quartz_service.Tools;
using System.Reflection;

namespace quartz_service
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var builder = WebApplication.CreateBuilder(args);
            builder.Services.AddQuartz();

            var assembly = Assembly.GetEntryAssembly();
            if (assembly != null)
            {
                var logRepository = LogManager.GetRepository(assembly);
                XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
            }

            AppsettingsTool.Configuration = builder.Configuration;

            var app = builder.Build();

            app.MapGet("/", () => "Hello World!");

            app.Run();
        }
    }
}
